package com.zker.missyou.sample;


import com.zker.missyou.sample.hero.Diana;
import com.zker.missyou.sample.hero.Irelia;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HeroConfiguration {
//    @Bean
    @Bean
    @ConditionalOnProperty(value = "hero.condition", havingValue = "diana")
    public ISkill diana() {
        return new Diana("Diana", 18);
    }

    @Bean
    @ConditionalOnProperty(value = "hero.condition", havingValue = "irelia")
    public ISkill irelia() {
        return new Irelia();
    }


}

